import request from "@/utils/request";

// Query message list
export function listMessage(query) {
  return request({
    url: "/system/message/list",
    method: "get",
    params: query,
  });
}

// Get message detail
export function getMessage(messageId) {
  return request({
    url: "/system/message/" + messageId,
    method: "get",
  });
}

// Add message
export function addMessage(data) {
  return request({
    url: "/system/message",
    method: "post",
    data: data,
  });
}

// Update message
export function updateMessage(data) {
  return request({
    url: "/system/message",
    method: "put",
    data: data,
  });
}

// Delete message
export function delMessage(messageId) {
  return request({
    url: "/system/message/" + messageId,
    method: "delete",
  });
}

// Mark message as read
export function readMessage(messageId) {
  return request({
    url: "/system/message/read/" + messageId,
    method: "put",
  });
}

// Mark multiple messages as read
export function readMessageBatch(messageIds) {
  return request({
    url: "/system/message/read/batch",
    method: "put",
    data: messageIds,
  });
}
